package cn.itsource.service.impl;

import cn.itsource.pojo.domain.Employee;
import cn.itsource.mapper.EmployeeMapper;
import cn.itsource.result.JSONResult;
import cn.itsource.service.IEmployeeService;
import cn.itsource.utils.RConst;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author tt
 * @since 2024-09-09
 */
@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements IEmployeeService {

    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public JSONResult updateState(Long id) {
        Employee employee = this.getOne(new LambdaQueryWrapper<Employee>().eq(Employee::getId, id));
        employee.setState(RConst.Num.INT_2);
        return JSONResult.success();
    }
}
